/*
 * Copyright 2009 rashaguo <rashaguo@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef HTTPLIKESERVICE_H
#define HTTPLIKESERVICE_H

#include "service.h"
#include "server.h"

class WebServerWrapper;

class HttpLikeService : public Service, public Server
{
public:
    HttpLikeService();

    virtual ~HttpLikeService();

    virtual void run();

    virtual void process(unsigned int session_id,
                        std::string request_id,
                        std::string request_type,
                        std::string request);

    virtual void stop();

    virtual std::string getServiceName();

    bool isServerRunning();

    void go();

    std::string getServerLocalIP();

    std::string getServerLocalPort();

    std::string getServerNatIP();

    std::string getServerNatPort();

    bool isNat();

protected:

    WebServerWrapper *m_webServer;

    std::string m_serviceName;

    std::string m_localIP;

    std::string m_localPort;

};
#endif
